import React, { Component } from 'react'

export default class Ev extends Component{
    render(){
        return <div>
                <h2>react合成事件</h2>
                <div ref="divDom" onClick={()=>console.log(1)}>
                    这是一个div
                </div>
        </div>
    }
    componentDidMount(){
        this.refs.divDom.addEventListener('click',()=>console.log(2))
    }
}